import React, { Component } from 'react'
import { SearchOutline } from 'antd-mobile-icons'
import './inedx.scss'

export default class HomeHead extends Component {
  render() {
    return (
      <div className="sh_head clearfix">
        <div className="head-log" onClick={() => this.goUser('/user')}>
          <img src={ this.props.headImg ? this.props.headImg : "https://img0.baidu.com/it/u=1489807627,808259306&fm=26&fmt=auto" } alt="头像" />
        </div>
        <div className="head-sousuo clearfix" onClick={() => this.goSearch('/search')}>
          <div className='head-searchlogo'><SearchOutline /> </div>
          <div className="head-text">搜索入口</div>
        </div>
        <div className="head-login" onClick={() => this.goSearch('/search')}>搜索</div>
      </div>
    )
  }
  // 去搜索页(子组件给父组件传参)
  goSearch = (value) => {
    this.props.goSearch(value)
  }
  // 去用户页
  goUser = (value) => {
    this.props.goUser(value)
  }
}
